#include <cstdio>
#include <cstdlib>
#include <ctime>

using namespace std;

const int n=5, m=5;

void makeData() {
    FILE *f=fopen("score.in", "w");
    fprintf(f, "%d %d\n", n, m);
    for (int i=2; i<=n; i++) {
        fprintf(f, "%d %d\n", rand()%(i-1)+1, i);
    }
    for (int i=1; i<=m; i++) {
        fprintf(f, "%d %d %d\n", rand()%n+1, rand()%n+1, rand()%20-10);
    }
    fclose(f);
}

int main() {
    srand(time(0));
    for (;;) {
        makeData();
        if (system("./check")) {
            printf("CE\n");
            return -1;
        } else if (system("./bin")) {
            printf("RE\n");
            return -1;
        } else if (system("cmp check.out score.out")) {
            printf("WA\n");
            return -1;
        }
    }
    return 0;
}
